package com.sihan.framework.etm.entity;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.framework.model.BaseModel;
import com.framework.mybatis.annotation.AutoGenerator;
import com.framework.mybatis.enums.IdType;

import java.io.Serializable;

import javax.persistence.*;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

/**
 * 权限表
 */
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@Table(name = "jdx_org")
public class Permission extends BaseModel implements Serializable {

	private static final long serialVersionUID = 1L;

	/**
	 * 权限ID
	 */
	@Id
	@Column(name = "ID")
	@GeneratedValue(strategy = GenerationType.AUTO)
	@AutoGenerator(idType = IdType.UUID32)
	private String id;

	/**
	 * 父类权限ID
	 */
	private String parentId;

	/**
	 * 权限名称
	 */
	private String name;

	/**
	 * 权限标识
	 */
	private String identify;

	/**
	 * 资源类型
	 */
	private String resourceType;

	/**
	 * 图标(菜单使用)
	 */
	private String icon;

	/**
	 * 菜单URL
	 */
	private String url;

	/**
	 * 静态文件URL
	 */
	private String fileUrl;

	/**
	 * 排序号
	 */
	private Integer sort;

	/**
	 * 是否可用：0 不可用；1可用；默认为1
	 */
	private Boolean available;

	@JsonIgnore
	private Boolean isDelete;

//  @JsonIgnore
//  private Boolean isDefault;

	public Permission(Boolean isDelete) {
		this.isDelete = isDelete;
	}
}
